package org.donhuan.rms.ui.editors;

import org.donghuan.rms.framework.domain.Archive;
import org.donhuan.rms.ui.model.ITreeAndWorkbenchAdapter;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

public class ArchiveEditorInput implements IEditorInput {
	private Archive element;

	public ArchiveEditorInput(Archive element) {
		this.element = element;
	}
	public Archive getElement(){
		return this.element;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public Object getAdapter(Class adapter) {
		return Platform.getAdapterManager().getAdapter(element,
				adapter);
	}

	@Override
	public boolean exists() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		return ((ITreeAndWorkbenchAdapter) getAdapter(ITreeAndWorkbenchAdapter.class))
				.getImageDescriptor(element);
	}

	@Override
	public String getName() {
		return ((ITreeAndWorkbenchAdapter) getAdapter(ITreeAndWorkbenchAdapter.class))
				.getLabel(element);
	}

	@Override
	public IPersistableElement getPersistable() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getToolTipText() {
		// TODO Auto-generated method stub
		return null;
	}

}
